<!--
 * @Author: BlueSkyDream
 * @Date: 2023-02-24 18:06:20
 * @LastEditTime: 2023-04-11 09:11:40
 * @Description: 待填充
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8"/>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
  </head>
  <body>
    <button id="postSend" style="display:inline-block;text-align:center;margin: 0 auto;">发送post请求</button>
    <script>
      $('#postSend').click(()=>{
        $.ajax({
          data:{
            username:"hu1",
            password:"chen",
            age:2
          },
          url:"http://127.0.0.1:8083/xhr-post",
          dataType:"json",
          type:"POST",
          success:data=>{
            console.log(data)
          },
          error:(jqXHR,textStatus,errorThrown)=>{
            console.log('error'+textStatus+''+errorThrown)
          }
        })
      })
    </script>
  </body>
</html>